Xceed Grid for WinForms provides various properties that let you specify how the grid's appearance changes as users interact with it, using interactive visual styles. The table below lists the visual styles, the elements to which they can be applied, and a description.
Visual style | Elements in the grid affected | Description |
---|---|---|
HotVisualStyle | Cell, FixedColumnSplitter, GroupMargin, Row, and RowSelector; VisualGridElementStyle | Used when the pointer moves over the item. |
SelectionVisualStyle | DetailGrid, GridControl; GridStyle | Used when the item is selected and active. |
InactiveSelectionVisualStyle | DetailGrid, GridControl; GridStyle | Used when the item is selected but inactive. |
ErrorVisualStyle | DetailGrid, GridControl; GridStyle | Used when the item is in an error state. |
The following code snippet demonstrates how to set the hot visual style of the cells in a grid control, using a gradient map (see Gradient maps for details). When the pointer moves over a cell (making it "hot"), a gradient (red, light green, and blue) is displayed under that cell.
VB.NET | Copy Code |
---|---|
|
C# | Copy Code |
---|---|
|
The following code snippet demonstrates how to set the selction visual style of the rows in a grid control. When a row is selected, its foreground and background colors will be changed to red and silver, respectively.
VB.NET | Copy Code |
---|---|
GridControl1.SelectionVisualStyle.ForeColor = Color.Red |
C# | Copy Code |
---|---|
gridControl1.SelectionVisualStyle.ForeColor = Color.Red; |